package com;

/**
 * Created by IntelliJ IDEA.
 * User: BGONZ8
 * Date: 9/23/11
 * Time: 5:08 PM
 * To change this template use File | Settings | File Templates.
 */
public class TransactionFile {
    private String xmlString;
    private String unitCode = "-1";
    private String salesOrg = "-1";
    private String compNumber = "-1";
    private String customerNumber = "124135154";
    private String transactionID = "nri3682026";
    private String sourceSystemCode = "GD";
    private String allocationCode = "12345";
    private String referenceNumber = "12345";
    private String transactionType = "1003";
    private String customerRequestedDeliveryDate = ""; //"2010-10-26T21:32:52";
    private String quantity = "0";

    public String getQuantity() {
        return quantity;
    }

    public void setQuantity(String quantity) {
        this.quantity = quantity;
    }

    public String getCustomerRequestedDeliveryDate() {
        return customerRequestedDeliveryDate;
    }

    public void setCustomerRequestedDeliveryDate(String customerRequestedDeliveryDate) {
        this.customerRequestedDeliveryDate = customerRequestedDeliveryDate;
    }

    public String getTransactionType() {
        return transactionType;
    }

    public void setTransactionType(String transactionType) {
        this.transactionType = transactionType;
    }

    public String getSourceSystemCode() {
        return sourceSystemCode;
    }

    public void setSourceSystemCode(String sourceSystemCode) {
        this.sourceSystemCode = sourceSystemCode;
    }

    public String getUnitCode() {
        return unitCode;
    }

    public void setUnitCode(String unitCode) {
        this.unitCode = unitCode;
    }

    public String getXmlString() {
        return sampleXML();
    }

    public String getSalesOrg() {
        return salesOrg;
    }

    public void setSalesOrg(String salesOrg) {
        this.salesOrg = salesOrg;
    }

    public String getCompNumber() {
        return compNumber;
    }

    public void setCompNumber(String compNumber) {
        this.compNumber = compNumber;
    }

    public String getCustomerNumber() {
        return customerNumber;
    }

    public void setCustomerNumber(String customerNumber) {
        this.customerNumber = customerNumber;
    }

    public String getTransactionID() {
        return transactionID;
    }

    public void setTransactionID(String transactionID) {
        this.transactionID = transactionID;
    }

    public String getAllocationCode() {
        return allocationCode;
    }

    public void setAllocationCode(String allocationCode) {
        this.allocationCode = allocationCode;
    }

    public String getReferenceNumber() {
        return referenceNumber;
    }

    public void setReferenceNumber(String referenceNumber) {
        this.referenceNumber = referenceNumber;
    }

    public String toString()
    {
        return sampleXML();
    }


    private String sampleXML()
    {
        String retval = "";
        retval = "" +
                "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" +
                "<feed xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n" +
                " xsi:noNamespaceSchemaLocation=\"LockerTransactionFeed.xsd\"\n" +
                " sourceSystemCode=\""+getSourceSystemCode()+"\">\n" +
                "<transaction>\n" +
                "    <header>\n" +
                "        <transactionID>"+getTransactionID()+"</transactionID>\n" +
                "        <customerNumber>"+getCustomerNumber()+"</customerNumber>\n" +
                "        <compNumber>"+getCompNumber()+"</compNumber>\n" +
                "        <description></description>\n" +
                "        <transactionDateTime>2010-10-26T21:32:52</transactionDateTime>\n" +
                "        <transactionType>"+getTransactionType()+"</transactionType>\n" +
                "        <referenceNumber>"+getReferenceNumber()+"</referenceNumber>\n" +
                "        <allocationCode>"+getAllocationCode()+"</allocationCode>\n" +
                "        <storeNumber>12345</storeNumber>\n" +
                "        <storeName>Â DIG</storeName>\n" +
                "        <sourceSystemUserid>0000000000</sourceSystemUserid>\n" +
                "        <contractCode/>\n" +
                "        <costCenter/>\n" +
                "        <customerRequestedDeliveryDate xsi:nil=\"true\">"+customerRequestedDeliveryDate+"</customerRequestedDeliveryDate>\n" +
                "        <salesOrg>"+getSalesOrg()+"</salesOrg>\n" +
                "    </header>\n" +
                "    <item>\n" +
                "        <lineNumber>100</lineNumber>\n" +
                "        <description> HYPERWARM COMPRESSION TIGHT</description>\n" +
                "        <style>259864</style>\n" +
                "        <color>010</color>\n" +
                "        <costAmount currencyCode=\"USD\">0.000000000</costAmount>\n" +
                "        <wholesaleAmount currencyCode=\"USD\">0.000000000</wholesaleAmount>\n" +
                "        <retailAmount currencyCode=\"USD\">0.000000000</retailAmount>\n" +
                "        <divisionCode>10</divisionCode>\n" +
                "        <size>XL</size>\n" +
                "        <quantity>"+quantity+"</quantity>\n" +
                "        <unitCode>"+getUnitCode()+"</unitCode>\n" +
                "    </item>\n" +
                "</transaction>\n" +
                "</feed>" ;

        return retval;
    }
}
